﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LanguageDetector
{
    public class TrainerDoneEventArgs : EventArgs
    {
        public TrainerDoneEventArgs(
            Object input,
            LanguageStat lang, 
            Dictionary<BiGram, BiGramStat> results, 
            ICollection<Exception> errors, 
            TimeSpan duration)
            : base()
        {
            _input = input;
            _lang = lang;

            if (!results.IsNullOrEmpty())
                _result = results;

            if (errors != null)
                _errors.AddRange(errors);

            _duration = duration;
        }

        object _input;
        public Object OriginalInput
        {
            get { return _input; }
        }

        TimeSpan _duration;
        public TimeSpan Duration
        {
            get { return _duration; }
        }

        LanguageStat _lang;
        public LanguageStat LanguageStat
        {
            get { return _lang; }
        }

        Dictionary<BiGram, BiGramStat> _result = new Dictionary<BiGram, BiGramStat>();
        public Dictionary<BiGram, BiGramStat> Result
        {
            get { return _result; }
        }

        List<Exception> _errors = new List<Exception>();
        public List<Exception> Errors
        {
            get { return _errors; }
        }
    }
}
